import type * as Activity from "./type"
import { request } from "@/http/axios"

/** 获取活动列表 */
export function getActivityListApi(params: Activity.CurrentActivityResponseData) {
  return request<Activity.ListData>({
    url: "hd_activity/getList",
    method: "get",
    params
  })
}

/** 获取活动详情 */
export function getActivityDetailApi(params: Activity.CurrentActivityResponseData) {
  return request<Activity.DetailData>({
    url: "hd_activity/detail",
    method: "get",
    params
  })
}

export function createOrUpdateActivityDataApi(data: Activity.CreateOrUpdateActivityRequestData) {
  return request({
    url: "hd_activity/save",
    method: "post",
    data
  })
}

export function deleteActivityDataApi(data: Activity.DeleteActivityRequestData) {
  return request({
    url: "hd_activity/del",
    method: "post",
    data
  })
}

export function getActivityCommentApi(params: Activity.GetActivityCommentResponseData) {
  return request<Activity.DetailData>({
    url: "hd_comment/getList",
    method: "get",
    params
  })
}

export function updateActivityCommentDataApi(data: Activity.DeleteActivityRequestData) {
  return request({
    url: "hd_comment/save",
    method: "post",
    data
  })
}

export function createActivityCommentDataApi(data: Activity.DeleteActivityRequestData) {
  return request({
    url: "hd_comment/add",
    method: "post",
    data
  })
}

export function deleteActivityCommentDataApi(data: Activity.DeleteActivityRequestData) {
  return request({
    url: "hd_comment/del",
    method: "post",
    data
  })
}
